@import '_variables';
@import 'syntax_highlight';
@import 'mixin';

/*=========
  页面初始化
=========*/
::selection {
  background-color: $selection_bgcolor;
  color: $selection_color;
}

html {
  font-size: $glob_font_size;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-rendering: optimizelegibility;
}

body {
  background-color: #fff;
  color: #444;
  font: 1.4rem/1.8 $glob_font_family;
  -webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

ul, ol, li {
  list-style: none;
  margin: 0;
  padding: 0;
}

a {
  text-decoration: none;
  color: #1FAE89;
}

p {
  margin-bottom: 1.2em;
}

img {
  max-width: 100%;
  padding: 0.5em 0;
  margin: auto;
  display: block;
}

.oldbrowser {
  line-height: 50px;
  background: red;
  color: #fff;
  text-align: center;
  font-size: 16px;
  font-weight: bold;
}


/*=========
  table
=========*/
table {
    width:           100%;
    background:      transparent;
    border-collapse: collapse;
    border-spacing:  0;
    text-align:      left;
    th {
        font-weight:    bold;
        padding-bottom: 0.5em;
        border-bottom:  2px solid lighten(#dce4f1, 2);
    }
    td {
        border-bottom: 1px solid lighten(#dce4f1, 2);
        padding:       1rem 0;
    }
}

/*=========
  页面样式
=========*/

header {
  width: 100%;
}

.header {
  width: 80%;
  height: 15rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
  .site__name {
    display: flex;
    align-items: center;
  }
  .menu {
    display: flex;
    align-items: center;
    .menu__item {
      font-size: 2rem;
      a {
        display: inline-block;
        padding: 3px 15px;
        font-size: 1.8rem;
        background-color: #1FAE89;
        color: #fff;
        border-radius: 20px 0 20px 0;
        box-shadow: 0 3px 0px #0D7377;
        font-weight: bold;
      }
      & + .menu__item {
        margin-left: 60px;
      }
    }
  }
}

@media screen and (max-width: 480px) {
  .header {
    .menu {
      .menu__item {
        & + .menu__item {
          margin-left: 10px;
        }
      }
    }
  }
}

.content {
  width: 800px;
  margin: 50px auto 50px;
}

.comment {
  width: 800px;
  margin: 0 auto;
}

@media screen and (max-width: 800px) and (min-width: 480px) {
  .content {
    width: 90%;
  }

  .comment {
    width: 90%;
  }
}

@media screen and (max-width: 480px) {
  .content {
    width: 90%;
  }

  .comment {
    width: 90%;
  }
}


.content__index {
  .posts {
    overflow: hidden;
    .post {
      margin-top: 60px;
      &::after {
        content: '';
        display: block;
        width: 100%;
        height: 5px;
        margin: 30px auto 0;
        background: url(/images/leaf.png) repeat 0 0 / 31px 5px;
      }

      .post__title {
        text-align: left;
        font-size: 2.4rem;
        margin-bottom: 5px;
        a {
          display: inline-block;
          color: #333;
          &::after{
            content: '';
            display: block;
            width: 0;
            margin: 5px auto 0;
            height: 3px;
            background-color: #1FAE89;
          }
          &:hover {
            &::after {
              width: 100%;
              transition: width .5s ease .1s;
            }
          }
        }
      }

      .post__date {
        text-align: left;
        font-size: 1.4rem;
        color: #aaa;
        font-style: italic;
      }

      .post__content {
        font-size: 1.6rem;
      }
    }
  }
}

.post__tags {
  text-align: right;
  margin-top: 20px;
  a {
    line-height: 1.7rem;
    display: inline-block;
    margin-left: 1em;
    position: relative;
    padding-left: 1.5em;
    padding-right: 1.5em;
    border-radius: 0 .28571429rem .28571429rem 0;
    -webkit-transition: none;
    transition: none;
    background-color: #ebfaf2;
    border-color: #00b5ad;
    color: #1FAE89;
    &::before {
      box-sizing: border-box;
      position: absolute;
      -webkit-transform: translateY(-50%) translateX(50%) rotate(-45deg);
      transform: translateY(-50%) translateX(50%) rotate(-45deg);
      top: 50%;
      right: 100%;
      content: '';
      background-color: inherit;
      background-image: none;
      width: 1.2rem;
      height: 1.2rem;
      -webkit-transition: none;
      transition: none;
    }
    &::after {
      position: absolute;
      content: '';
      top: 50%;
      left: -.25em;
      margin-top: -.25em;
      background-color: #fff!important;
      width: .5em;
      height: .5em;
      box-shadow: 0 -1px 1px 0 rgba(0,0,0,.3);
      border-radius: 500rem;
    }
  }
}

.content__post {
  &::after {
    content: '';
    display: block;
    width: 100%;
    height: 5px;
    margin: 30px auto 0;
    background: url(/images/leaf.png) repeat 0 0 / 31px 5px;
  }
  p {
    font-size: 1.6rem;
  }
  .post__title {
    text-align: center;
  }
  .post__date {
    text-align: center;
  }
}

.post_paginator {
  margin: 30px 0;
  text-align: center;
  @include clearfix;
  .pre {
    float: left;
    &::before {
      content: '< ';
    }
  }

  .next {
    float: right;
    &::after {
      content: ' >';
    }
  }
}

.paginator {
  margin-top: 50px;
  @include clearfix;
  a {
    display: inline-block;
    padding: 5px 10px;
    font-size: 1.6rem;
    background-color: #ebfaf2;
    color: #1FAE89;
    border: 1px solid;
    border-radius: 5px;

    &:hover {
      background-color: #D7F6E5;
    }
    &:first-child {
      order: 1;
    }
    &:last-child {
      order: 0;
    }
  }
  .pre {
    float: left;
  }
  .next {
    float: right;
  }
}

.post__achive {
  margin: 70px auto 30px;
  h2 {
    font-size: 2.4rem;
  }
  .achive__list {
    li {
      & + li {
        margin-top: 10px;
      }
      span {
        font-size: 1.6rem;
      }

      a {
        font-size: 1.6rem;
        margin-left: 20px;
      }
    }
  }
}

@media screen and (max-width: 480px) {
  .achive__list {
    li {
      span {
        width: 90px;
        display: inline-block;
        vertical-align: top;
      }

      a {
        width: calc(90% - 100px);
        display: inline-block;
      }
    }
  }
}

.about {
  margin: 70px auto 30px;
}

.copynight {
  text-align: center;
  margin: 100px 0 40px;
  color: #444;
  a {
    color: #1FAE89;
  }
}
